import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import { TDesignResolver } from '@tdesign-vue-next/auto-import-resolver'
import Components from 'unplugin-vue-components/vite'
import autoprefixer from 'autoprefixer'
import tailwindcss from 'tailwindcss'
// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      imports: [
        'vue',
        {
          'naive-ui': ['useDialog', 'useMessage', 'useNotification', 'useLoadingBar']
        }
      ],
      resolvers: [
        TDesignResolver({
          library: 'chat'
        })
      ]
    }),
    Components({
      resolvers: [
        NaiveUiResolver(),
        TDesignResolver({
          library: 'chat'
        })
      ]
    }),
  ],
  css: {
    postcss: {
      plugins: [autoprefixer, tailwindcss]
    }
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  }
})
